package cn.ml.web3.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class HelloWorldServlet extends HttpServlet {

    @Override
    public void init() throws ServletException {
        System.out.println("init..........");

    }
    @Override
    public void destroy() {
        System.out.println("destroy.....");
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doGet(req, resp);
    }
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("service........");
        PrintWriter out = resp.getWriter();
        out.println("hello world");
        out.flush();
        out.close();
    }
}
